from TurtleWorld import *
from math import *
 
world=TurtleWorld()
lips=Turtle()
 
#----------------------------TRIANGLES----------------------------------#

def equilateral_tri(t, size= int(input("hi. number for size ")), rotate = int(input("hi. number for equilateral_tri rotate: "))):
  print "Equilateral Triangle, with Size:", size, "and Rotation:", rotate
  t.lt(rotate)
  count = 1
  while count <= 3:
    t.fd(size)
    t.lt(120)
    count += 1
  t.rt(rotate)
#--------------------------QUADRILATERALS------------------------------#
def forword(t,size=200):
    t.pu()
    t.fd(size)
    t.pd()

def para(t, width=100, height=200, angle=60,angletwo=120, rotate= int(input("hi. number for rotate "))):
  print "Parallelogram, with Width:", width, "Height:", height, "Angle:", angle, "and Rotation:", rotate
  t.lt(rotate)
  count = 1
  while count <= 2:
    t.fd(height)
    t.lt(angle)
    t.fd(width)
    t.lt(angletwo)
    count += 1
  t.rt(rotate)
def rhom(t, size=int(input("hi. number for size ")), angle=60, angletwo=120, rotate=int(input("hi. number for rotate "))):
    t.lt(rotate)
    count = 1 
    while count <= 2:
        t.fd(size)
        t.lt(angle)
        t.fd(size)
        t.lt(angletwo)
        count+=1
    t.rt(rotate)
def rect(t, width = 100, height = 50, rotate = int(input("hi. number for rotate "))):
    t.lt(rotate)
    count = 1
    while count <= 3: 
        t.fd(width)
        t.lt()
        t.fd(height)
        t.lt()
        count += 1
    t.rt(rotate)
def square(t, size=int(input("hi. number for size ")), rotate=int(input("hi. number for rotate "))):
  t.lt(rotate)
  count = 1
  while count <= 4:
    t.fd(size)
    t.lt()
    count += 1 
  t.rt(rotate)
#------------------------------MOVEMENT---------------------------------#

def line(t, x=int(input("hi. number for x ")), y=int(input("hi. number for y "))):
  print "Line to a point X:", x, "over and Y:", y, "up"
  dist=sqrt(x**2+y**2)
  angle=degrees(atan(y/float(x)))
  t.lt(angle)
  t.fd(dist)
  t.rt(angle)
def move(t, x, y):
  print "Move without marking to a point X:", x, "over and Y:", y, "up"
  t.pu()
  line(t,x,y)
  t.pd()
#------------------------------OTHER SHAPES-----------------------------#
"""
Build any other shape functions you want.
Some Ideas:
  Right Triangles (sss, sas, etc)
  Arbitrary Triangles
  Circle
  Arcs
  Go Wild!
  
Bonus for working or challenging functions...no penalty for trying something
"""


#------------------------------TEST-----------------------------------#
equilateral_tri(lips)
forword(lips)
rhom(lips)
forword(lips)
para(lips)
forword(lips)
square(lips)
forword(lips)
rect(lips)
forword(lips)
line(lips)
move(lips)


wait_for_user()